
<h1>Reorder this list</h1>

<h2><%= link_to "<< Back to My Lists", :action => :index %></h2>
<h2><%= @list.name %> </h2>

<%if @items.length > 0 %>
  <% form_for :reorder, :url => { :action => :save_item_order } do |form| %><% end %>
    <ul class="list_items">
	    <% @items.each do |item| %>
	      <% domid = "todo_#{item.id}" %>      
	      <li id="<%= domid %>">
		      <%= image_tag("/images/drag.gif", :class => "drag_img", :size => "25x11") %><%= item.content %>
		    </li>
	    <% end %>
    </ul>
    <%= sortable_element 'list_items', :url => {:action => 'sort_todos'} %>
    <div>
	    <span><%= submit_tag 'Done reordering' %></span>
	    <span class="cancel"><%= link_to "Cancel", :action => :show, :id => @list.id %></span>
	  </div>
  
<% else %>
  There are no list items for this list.
<% end %>


<% if flash[:notice] -%>
  <div id="notice"><%= flash[:notice] %></div>
<% end -%>

